home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / MPW / fgrep 1.1 / fgrep.r < prev    next >
Encoding:
Text File  |  1993-03-14  |  5.4 KB  |  328 lines  |  [TEXT/MPS ]

  1. /*
  2.  *    fgrep.r
  3.  *
  4.  *    Franklin Chen
  5.  */
  6.  
  7. #include "SysTypes.r"
  8. #include "Cmdo.r"
  9.  
  10. resource 'vers' (1) {
  11.     0x1,
  12.     0x1,
  13.     release,
  14.     0x0,
  15.     verUS,
  16.     "1.1",
  17.     "1.1 © 1989 FSF, Inc.\nMPW port by Franklin Chen"
  18. };
  19.  
  20. resource 'vers' (2) {
  21.     0x1,
  22.     0x1,
  23.     release,
  24.     0x0,
  25.     verUS,
  26.     "1.1",
  27.     "GNU for MPW"
  28. };
  29.  
  30. resource 'cmdo' (128) {
  31.     {    /* array dialogs: 2 elements */
  32.         /* [1] */
  33.         299,
  34.         "fgrep -- GNU fgrep prints lines matchin"
  35.         "g an expression.",
  36.         {    /* array itemArray: 19 elements */
  37.             /* [1] */
  38.             Or {
  39.                 {    /* array OrArray: 1 elements */
  40.                     /* [1] */
  41.                     -2
  42.                 }
  43.             },
  44.             RegularEntry {
  45.                 "Expression",
  46.                 {68, 17, 85, 94},
  47.                 {68, 97, 85, 332},
  48.                 "",
  49.                 keepCase,
  50.                 "-e",
  51.                 "Search for the expression entere"
  52.                 "d here."
  53.             },
  54.             /* [2] */
  55.             Or {
  56.                 {    /* array OrArray: 1 elements */
  57.                     /* [1] */
  58.                     -1
  59.                 }
  60.             },
  61.             Files {
  62.                 InputFile,
  63.                 OptionalFile {
  64.                     {22, 184, 38, 287},
  65.                     {37, 183, 56, 310},
  66.                     "Expression file",
  67.                     "",
  68.                     "-f",
  69.                     "",
  70.                     "Search for the expression contained in t"
  71.                     "his file.",
  72.                     dim,
  73.                     "Use command line",
  74.                     "Use expression in file…",
  75.                     ""
  76.                 },
  77.                 Additional {
  78.                     "",
  79.                     "",
  80.                     "",
  81.                     "",
  82.                     {    /* array TypesArray: 1 elements */
  83.                         /* [1] */
  84.                         text
  85.                     }
  86.                 }
  87.             },
  88.             /* [3] */
  89.             NotDependent {
  90.  
  91.             },
  92.             MultiFiles {
  93.                 "Files to search…",
  94.                 "Select the files to search. If none is s"
  95.                 "elected, standard input will be searched"
  96.                 ".",
  97.                 {18, 18, 37, 145},
  98.                 "Files that will be searched:",
  99.                 "",
  100.                 MultiInputFiles {
  101.                     {    /* array MultiTypesArray: 1 elements */
  102.                         /* [1] */
  103.                         text
  104.                     },
  105.                     "",
  106.                     "",
  107.                     ""
  108.                 }
  109.             },
  110.             /* [4] */
  111.             NotDependent {
  112.  
  113.             },
  114.             Redirection {
  115.                 StandardOutput,
  116.                 {11, 349}
  117.             },
  118.             /* [5] */
  119.             NotDependent {
  120.  
  121.             },
  122.             Redirection {
  123.                 DiagnosticOutput,
  124.                 {52, 349}
  125.             },
  126.             /* [6] */
  127.             NotDependent {
  128.  
  129.             },
  130.             CheckOption {
  131.                 NotSet,
  132.                 {97, 12, 113, 155},
  133.                 "MPW-style",
  134.                 "-m",
  135.                 "Use MPW-style filename and line number o"
  136.                 "utput."
  137.             },
  138.             /* [7] */
  139.             NotDependent {
  140.  
  141.             },
  142.             CheckOption {
  143.                 NotSet,
  144.                 {124, 12, 140, 147},
  145.                 "Version",
  146.                 "-V",
  147.                 "Print the version number of this release"
  148.                 " on diagnostic output."
  149.             },
  150.             /* [8] */
  151.             And{{-14,-16,-17}},
  152.             CheckOption {
  153.                 NotSet,
  154.                 {152, 12, 168, 149},
  155.                 "Byte offsets",
  156.                 "-b",
  157.                 "Print every match preceded by its byte o"
  158.                 "ffset."
  159.             },
  160.             /* [9] */
  161.             And{{-14,-16,-17}},
  162.             CheckOption {
  163.                 NotSet,
  164.                 {170, 12, 186, 152},
  165.                 "Line numbers",
  166.                 "-n",
  167.                 "Print each match preceded by its line nu"
  168.                 "mber."
  169.             },
  170.             /* [10] */
  171.             NotDependent {
  172.  
  173.             },
  174.             CheckOption {
  175.                 NotSet,
  176.                 {97, 153, 113, 285},
  177.                 "Ignore case",
  178.                 "-i",
  179.                 "Ignore case difference when comparing st"
  180.                 "rings."
  181.             },
  182.             /* [11] */
  183.             Or{{-14}},
  184.             CheckOption {
  185.                 NotSet,
  186.                 {134, 153, 150, 304},
  187.                 "Nonmatches only",
  188.                 "-v",
  189.                 "Print only lines that contain no matches"
  190.                 " for the expression."
  191.             },
  192.             /* [12] */
  193.             And{{-14,-13}},
  194.             CheckOption {
  195.                 NotSet,
  196.                 {152, 153, 168, 311},
  197.                 "Word matches only",
  198.                 "-w",
  199.                 "Print only lines where the match is a co"
  200.                 "mplete word."
  201.             },
  202.             /* [13] */
  203.             And{{-14,-12}},
  204.             CheckOption {
  205.                 NotSet,
  206.                 {170, 153, 186, 311},
  207.                 "Line matches only",
  208.                 "-x",
  209.                 "Print only lines where the match is a wh"
  210.                 "ole line."
  211.             },
  212.             /* [14] */
  213.             And{{-8, -9, -11, -12, -13, -15, -16, -17, -18}},
  214.             CheckOption {
  215.                 NotSet,
  216.                 {97, 316, 113, 451},
  217.                 "Silent",
  218.                 "-s",
  219.                 "Run silently producing no output except "
  220.                 "error messages."
  221.             },
  222.             /* [15] */
  223.             And{{-14,-16}},
  224.             CheckOption {
  225.                 NotSet,
  226.                 {134, 316, 150, 464},
  227.                 "No filenames",
  228.                 "-h",
  229.                 "Don't display filenames on matches."
  230.             },
  231.             /* [16] */
  232.             And{{-14,-15,-18,-8,-9}},
  233.             CheckOption {
  234.                 NotSet,
  235.                 {152, 316, 168, 447},
  236.                 "Filenames only",
  237.                 "-l",
  238.                 "Only list files containing matches."
  239.             },
  240.             /* [17] */
  241.             And{{-14,-18,-8,-9}},
  242.             CheckOption {
  243.                 NotSet,
  244.                 {170, 316, 186, 448},
  245.                 "Total counts only",
  246.                 "-c",
  247.                 "Only print a total count of matching lines."
  248.             },
  249.             /* [18] */
  250.             NotDependent {
  251.  
  252.             },
  253.             NestedDialog {
  254.                 2,
  255.                 {41, 17, 59, 145},
  256.                 "Context options…",
  257.                 "Options for context display may be set w"
  258.                 "ith this button."
  259.             },
  260.             /* [19] */
  261.             Or {
  262.                 {    /* array OrArray: 2 elements */
  263.                     /* [1] */
  264.                     1,
  265.                     /* [2] */
  266.                     2
  267.                 }
  268.             },
  269.             DoItButton {
  270.  
  271.             }
  272.         },
  273.         /* [2] */
  274.         197,
  275.         "Use this dialog to set context options.",
  276.         {    /* array itemArray: 3 elements */
  277.             /* [1] */
  278.             And{{-3,-4}},
  279.             RegularEntry {
  280.                 "Lines after:",
  281.                 {20, 22, 39, 104},
  282.                 {20, 130, 35, 179},
  283.                 "",
  284.                 keepCase,
  285.                 "-A",
  286.                 "Print <num> lines of context after every"
  287.                 " matching line."
  288.             },
  289.             /* [2] */
  290.             And{{-3,-4}},
  291.             RegularEntry {
  292.                 "Lines before:",
  293.                 {45, 22, 67, 116},
  294.                 {45, 130, 60, 179},
  295.                 "",
  296.                 keepCase,
  297.                 "-B",
  298.                 "Print <num> lines of context before ever"
  299.                 "y matching line."
  300.             },
  301.             /* [3] */
  302.             And{{-1,-2,-4}},
  303.             RegularEntry {
  304.                 "Lines before and after:",
  305.                 {70, 22, 92, 180},
  306.                 {70, 195, 85, 244},
  307.                 "",
  308.                 keepCase,
  309.                 "",
  310.                 "Print <num> lines of context on each side of every match.\n"
  311.                 "NOTE: prefix <num> by '-' so that this will be recognized"
  312.                 " as an option!"
  313.             },
  314.             /* [4] */
  315.             And{{-1,-2,-3}},
  316.             CheckOption {
  317.                 NotSet,
  318.                 {26, 230, 46, 384},
  319.                 "2 lines on each side",
  320.                 "-C",
  321.                 "Print 2 lines of context on each side of"
  322.                 " every match."
  323.             }            
  324.         }
  325.     }
  326. };
  327.  
  328.